package com.zxy.controller;

import com.zxy.common.ResultData;
import com.zxy.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Zxy
 * @Date: 2021-05-13
 **/
@RestController
public class TestController {

    @Autowired
    private ApplicationContext applicationContext;

    @RequestMapping("/test")
    public ResultData getBean(){
        Student bean = applicationContext.getBean(Student.class);
        System.out.println(bean);
        return ResultData.success(bean);
    }
}
